package com.zhihuiyanche.common.model;

import java.io.Serializable;
import java.util.List;

import net.sf.json.JSONObject;

import com.zhihuiyanche.common.constant.Oper;
import com.zhihuiyanche.common.constant.Type;


public class Data implements Serializable
{
	/**
	 * 
	 */
	private static final long	serialVersionUID	= 1L;

	private Long				t;
	private String				secret;
	private String				msg;
	private List<?>				data;
	private List<?>				menuList;
	private List<?> 			childMenuList;		//子菜单列表
	
	private JSONObject			json;

	private int					code;
	private Oper				oper;
	private Type				type;
	private String				source;
	private boolean				success;
	private Pagination			pagination;

	// 页面部分入参

	private String				tenantId;					// 企业id
	private String				organId;					// 机构d
	private String				openId;					// 用户openId
	private String				url;						// 用户传入的url,微信分享使用
	private String				menuId;					// 菜单点击量统计使用
	private String				parentMenuId;			//菜单父节点id
	private String				signStr;					// 返回的签名
	private String				requestStr;				// 入参参数，
	private String				queueId;					//排号系统的队列类型

	private String				result;					// 返回参数
	private int					total;
	private int					page;
	private int					rows;

	public int getTotal()
	{
		return total;
	}

	public void setTotal(int total)
	{
		this.total = total;
	}

	public int getPage()
	{
		return page;
	}

	public void setPage(int page)
	{
		this.page = page;
	}

	public int getRows()
	{
		return rows;
	}

	public void setRows(int rows)
	{
		this.rows = rows;
	}

	public String getResult()
	{
		return result;
	}

	public void setResult(String result)
	{
		this.result = result;
	}

	public String getOpenId()
	{
		return openId;
	}

	public void setOpenId(String openId)
	{
		this.openId = openId;
	}

	public String getUrl()
	{
		return url;
	}

	public void setUrl(String url)
	{
		this.url = url;
	}

	public static long getSerialversionuid()
	{
		return serialVersionUID;
	}

	public static Data get()
	{
		Data d = new Data();
		d.setT(System.currentTimeMillis());
		d.setSuccess(true);
		d.setCode(200);
		d.setSource("SERVER");
		d.setPagination(new Pagination());
		return d;
	}

	public static Data get(Integer code)
	{
		Data d = new Data();
		d.setT(System.currentTimeMillis());
		d.setSuccess(code == 200);
		d.setCode(code);
		d.setSource("SERVER");
		d.setPagination(new Pagination());
		return d;
	}

	public static Data get(Data data)
	{
		Data d = new Data();
		d.setT(data.getT());
		d.setSuccess(data.isSuccess());
		d.setCode(200);
		d.setSecret(data.getSecret());
		d.setType(data.getType());
		d.setOper(data.getOper());
		d.setSource("SERVER");
		d.setPagination(new Pagination());
		d.setTenantId(data.getTenantId());

		return d;
	}

	public Long getT()
	{
		return t;
	}

	public void setT(Long t)
	{
		this.t = t;
	}

	public String getSecret()
	{
		return secret;
	}

	public void setSecret(String secret)
	{
		this.secret = secret;
	}

	public String getMsg()
	{
		return msg;
	}

	public void setMsg(String msg)
	{
		this.msg = msg;
	}

	public List<?> getData()
	{
		return data;
	}

	public void setData(List<?> data)
	{
		this.data = data;
	}

	public int getCode()
	{
		return code;
	}

	public void setCode(int code)
	{
		this.code = code;
	}

	public Oper getOper()
	{
		return oper;
	}

	public void setOper(Oper oper)
	{
		this.oper = oper;
	}

	public Type getType()
	{
		return type;
	}

	public void setType(Type type)
	{
		this.type = type;
	}

	public String getSource()
	{
		return source;
	}

	public void setSource(String source)
	{
		this.source = source;
	}

	public boolean isSuccess()
	{
		return success;
	}

	public void setSuccess(boolean success)
	{
		this.success = success;
	}

	public Pagination getPagination()
	{
		return pagination;
	}

	public void setPagination(Pagination pagination)
	{
		this.pagination = pagination;
	}

	public String getTenantId()
	{
		return tenantId;
	}

	public void setTenantId(String tenantId)
	{
		this.tenantId = tenantId;
	}

	public String getSignStr()
	{
		return signStr;
	}

	public void setSignStr(String signStr)
	{
		this.signStr = signStr;
	}

	public String getRequestStr()
	{
		return requestStr;
	}

	public void setRequestStr(String requestStr)
	{
		this.requestStr = requestStr;
	}

	public String getOrganId()
	{
		return organId;
	}

	public void setOrganId(String organId)
	{
		this.organId = organId;
	}

	public String getQueueId()
	{
		return queueId;
	}

	public void setQueueId(String queueId)
	{
		this.queueId = queueId;
	}

	public JSONObject getJson()
	{
		return json;
	}

	public void setJson(JSONObject json)
	{
		this.json = json;
	}

	public List<?> getMenuList()
	{
		return menuList;
	}

	public void setMenuList(List<?> menuList)
	{
		this.menuList = menuList;
	}

	public String getMenuId()
	{
		return menuId;
	}

	public void setMenuId(String menuId)
	{
		this.menuId = menuId;
	}

	public String getParentMenuId()
	{
		return parentMenuId;
	}

	public void setParentMenuId(String parentMenuId)
	{
		this.parentMenuId = parentMenuId;
	}

	public List<?> getChildMenuList()
	{
		return childMenuList;
	}

	public void setChildMenuList(List<?> childMenuList)
	{
		this.childMenuList = childMenuList;
	}
}
